using System;
using System.Collections;
using System.Threading;
using SecuBat.AttackPlugin;

namespace SecuBat.Work
{
	/// <summary>
	/// Summary description for InitializeCommonDataTask.
	/// </summary>
	public class InitializeCommonDataTask : Task
	{
		private ICommonData _commonData;
		private ArrayList _selectedWebFormIds;

		public InitializeCommonDataTask(ICommonData commonData, ArrayList selectedWebFormIds)
		{
			_commonData = commonData;
			_selectedWebFormIds = selectedWebFormIds;
		}

		public override void Run()
		{
			base.Run();
			this.Status = TaskStatus.Initializing;
            this.TaskActivity = "Initializing common data";
            this.SignalizeStatusChange();
            Thread.Sleep(1);
			if (_commonData != null)
			{
				_commonData.InitializeData(_selectedWebFormIds);
			}
			this.Status = TaskStatus.Finished;
            this.SignalizeStatusChange();
		}
	}
}
